/*****系统模块********/
import { defineStore } from 'pinia'

export const systemStore = defineStore('system', {
  state: () => {
    return {
      statusBarInfo: {},
      loadingShow: false,
      errorShow: false,
      errorMsg: {}
    }
  },
  actions: {
    showLoading() {
      this.loadingShow = true
    },
    hideLoading() {
      this.loadingShow = false
    },
    showError() {
      this.errorShow = true
    },
    hideError() {
      this.errorShow = false
    },
    setErrorMsg(msg) {
      this.errorMsg = msg
    },
    setStatusBarInfo(info) {
      this.statusBarInfo = info
    }
  },
  getters: {
    getLoadingShow: (state) => state.loadingShow,
    getErrorShow: (state) => state.errorShow
  }
})
